<template>
    <div class="preview">
        <common-header>
            <template #text>
                <p>预览</p>
            </template>
        </common-header>
        <div class="preview-box">
            <div class="preview-entry">
                <p class="title" v-show="entry.entryCreation.title.length == 0?false:true">{{entry.entryCreation.title}}</p>
                <div class="info">
                    <span class="time">{{entry.entryCreation.time}} <span class="create">创建</span></span>
                    <span class="browse">100k次浏览</span>
                </div>
                <div class="content">
                    <p v-for="item in entry.entryCreation.content">{{item}}</p>
                </div>
                <div class="img-li">
                    <div class="img-box" v-for="item in entry.entryCreation.imgArr" :key="item.id">
                        <img :src="item.urlStr" alt="">
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import {mapState} from "vuex"
import CommonHeader from "../components/common-header.vue"
export default {
    name:"Preview",
    components:{
        CommonHeader
    },
    computed:{
        ...mapState(["entry"]),
        // this.conV=this.conV.replace(/[\n\r]/g,'<br>');
    },
}
</script>
<style lang="scss" scoped>
@import "../assets/common/base.scss";
.preview-box{
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: 92%;
    background-color: $bodyCol;
    overflow-y: scroll;
}
.preview-entry{
    background-color: #fff;
    padding: 15px 10px;
    .title{
        font-size: 17px;
        font-weight: bold;
        position: relative;
        padding-left: 18px;
        // margin: 15px 0 0 0;
        &::after{
            content: "";
            width: 6px;
            height: 18px;
            background-color: $mainCol;
            position: absolute;
            top: 3px;
            left: 0;
        }
    }
    .info{
        height: 30px;
        line-height: 30px;
        span{
            font-size: 12px;
            color: #999;
        }
        .time{
            margin-right: 15px;
        }
        .create{
            color: $moreCol;
        }
    }
    .content{
        margin-top: 10px;
        p{
            font-size: 14px;
            color: #666;
            line-height: 25px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 4;
            -webkit-box-orient: vertical;
        }
    }
     .img-li{
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-items: flex-start;
        .img-box{
            width: 100px;
            height: 100px;
            display: flex;
            align-items: center;
            position: relative;
            margin: 0 6px;
            img{
                width: 100%;
            }
        }
    }


}

</style>